package br.urca.model;

import java.io.Serializable;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 *
 * @author Lucas
 */
@Entity
@Table(name = "BI_IDIOMAS")
public class BiIdiomas implements Serializable {
	
    private static final long serialVersionUID = 1L;
    
    @Id
    @Basic(optional = false)
    @Column(name = "COD_IDIOMA")
    private Short codIdioma;
    
    @Basic(optional = false)
    @Column(name = "DESCRICAO")
    private String descricao;

    public BiIdiomas() {
    }

    public BiIdiomas(Short codIdioma) {
        this.codIdioma = codIdioma;
    }

    public BiIdiomas(Short codIdioma, String descricao) {
        this.codIdioma = codIdioma;
        this.descricao = descricao;
    }

    public Short getCodIdioma() {
        return codIdioma;
    }

    public void setCodIdioma(Short codIdioma) {
        this.codIdioma = codIdioma;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    @Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((codIdioma == null) ? 0 : codIdioma.hashCode());
		result = prime * result
				+ ((descricao == null) ? 0 : descricao.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		BiIdiomas other = (BiIdiomas) obj;
		if (codIdioma == null) {
			if (other.codIdioma != null)
				return false;
		} else if (!codIdioma.equals(other.codIdioma))
			return false;
		if (descricao == null) {
			if (other.descricao != null)
				return false;
		} else if (!descricao.equals(other.descricao))
			return false;
		return true;
	}

	@Override
    public String toString() {
        return "model.BiIdiomas[ codIdioma=" + codIdioma + " ]";
    }
    
}
